package com.lyw.login

import android.content.Context
import com.alibaba.android.arouter.facade.annotation.Route
import com.lu.library.kv.KVDelegate
import com.lyw.login_api.ILoginProvider
import com.lyw.login_api.LoginConstants
import com.lyw.login_api.LoginRoutePaths

@Route(path= LoginRoutePaths.PROVIDER_LOGIN)
class LoginProvider: ILoginProvider {

    private var _isLogin by KVDelegate(key=LoginConstants.KEY_USER_LOGIN,def=false)
    private var userInfo by KVDelegate(key=LoginConstants.KEY_USER_INFO,def="")
    override suspend fun logout() {

        _isLogin = false
        userInfo = ""
    }

    override fun isLogin(): Boolean {
        return _isLogin
    }

    override fun init(p0: Context?) {
    }
}